<?php get_header();?>
<?php get_menu();?>

<!-- start content-outer ........................................................................................................................START -->
<div id="content-outer">
<!-- start content -->
<div id="content">

	<!--  start page-heading -->
	<div id="page-heading">
		<h1>Ver usuarios asignados al cliente <strong><?php echo $name_customer; ?></strong> </h1><a href="<?php echo site_url('customer/view')?>">(volver a lista de clientes)</a>
	</div>
	<!-- end page-heading -->

	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td>
		<!--  start content-table-inner ...................................................................... START -->
		<div id="content-table-inner">
		
			<!--  start table-content  -->
			<div id="table-content">
			
				<!--  start message-yellow -->
				<!--<div id="message-yellow">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="yellow-left">You have a new message. <a href="">Go to Inbox.</a></td>
					<td class="yellow-right"><a class="close-yellow"><img src="images/table/icon_close_yellow.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>-->
				<!--  end message-yellow -->
				
				<!--  start message-red -->
				<?php if ($_message_error): ?>
				<div id="message-red">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="red-left"><?php echo $_message_error; ?></td>
					<td class="red-right"><a class="close-red"><img src="images/table/icon_close_red.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>
				<?php endif; ?>
				<!--  end message-red -->
				
				<!--  start message-blue -->
				<!--<div id="message-blue">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="blue-left">Welcome back. <a href="">View my account.</a> </td>
					<td class="blue-right"><a class="close-blue"><img src="images/table/icon_close_blue.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>-->
				<!--  end message-blue -->
			
				<!--  start message-green -->
				<?php if ($_message_sucessfully): ?> 
				<div id="message-green">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="green-left"><?php echo $_message_sucessfully; ?></td>
					<td class="green-right"><a class="close-green"><img src="images/table/icon_close_green.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>
				<?php endif; ?>
				<!--  end message-green -->

<?php if ($array_asign_customer_select): ?> 				
	<div id="search_form">	
		 <form  method="post" id="searchForm" action="<?php echo site_url('customer/asign_add')?>">
		 
		<table border="0" cellpadding="0" cellspacing="0" id="customer-table">			
		
			<tr>
				<td align="center"><strong>Asignar nuevo personal:</strong></td><td>&nbsp;&nbsp;&nbsp;</td>
				<td>
					<?php $atributes = 'id="staff" class="styledselect_form_1""';
						echo form_dropdown('staff', $array_asign_customer_select, '', $atributes);	
					?>
				</td>
				<td>&nbsp;&nbsp;&nbsp;</td>
				<td><input type="submit" id="submit" name="submit" value="submit" class="form-submit" />
					<input type="hidden" id="id_customer" name="id_customer" value="<?php echo $id_customer;?>" /> 
				</td>
			</tr>	
			<tr><td colspan="4">&nbsp;</td></tr>
		</table>	
		<br />
</form>
	</div>	
<?php endif; ?> 	
	
				<!--  start product-table ..................................................................................... -->
				<form id="mainform" action="">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-check"><a id="toggle-all" ></a> </th>
					<th class="table-header-repeat line-left minwidth-1"><span>Nombre del personal asignado</span></th>
				<th class="table-header-repeat line-left minwidth-1"><span>Tipo</span>
				</th>	

					<th class="table-header-options line-left"><span>Opciones</span></th>
				</tr>

	<?php  
	$num = 0;
	$noresultados =1;
	
	if ($array_asign_customer){
	foreach($array_asign_customer as $skin)

	{
	$noresultados =0;	
	$class_tr = (($num % 2)!==0)?'':'alternate-row';	

	?>
				<tr class="<?php echo $class_tr;?> ">
					<td><input  type="checkbox"/></td>
					
					<td><?php echo $skin['nombre']; ?></td>
					<td><?php echo $skin['tipo_usuario']; ?></td>					
					<td class="options-width">
		
					<?php if ($skin['tipo_usuario'] !== 'principal'): ?>
					<a href="<?php echo site_url('customer/asign_update/'.$id_customer.'/'.$skin['id_proyectos_cliente'])?>" title="Asignar este usuario como Principal" class="icon-3 info-tooltip"></a>

					<a href="<?php echo site_url('customer/asign_delete/'.$id_customer.'/'.$skin['id_proyectos_cliente'])?>" title="Eliminar este usuario del cliente" class="icon-2 info-tooltip"></a>	
					<?php endif; ?>				
					<!--<a href="" title="Edit" class="icon-5 info-tooltip"></a>-->
					</td>
				</tr>
				
	<?php $num++;
	}
	} else { 
	?>
		<tr class="alternate-row">
			<td colspan="4" align="center">No existen usuarios contenidos para este cliente</td>
		</tr>
	<?php 		
	}
	?>
	
	

				
				</table>
				<!--  end product-table................................... --> 
				</form>
			</div>
			
			<!--  end content-table  -->
		
			<!--  start actions-box ............................................... -->
			<div id="actions-box">
				<a href="" class="action-slider"></a>
				<div id="actions-box-slider">
					<a href="" class="action-edit">Edit</a>
					<a href="" class="action-delete">Delete</a>
				</div>
				<div class="clear"></div>
			</div>
			<!-- end actions-box........... -->
			
		
			<div class="clear"></div>
		 
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>

</div>
<!--  end content -->
<div class="clear">&nbsp;</div>
</div>
<!--  end content-outer........................................................END -->
<?php get_footer();?>